Document and test maximum deriveBits length for ECDH curves - #289
Merged
Conversation
Updates documentation on EcdhPrivateKey.deriveBits to include the maximum number of bits that can be derived for each curve: * EllipticCurve.p256 — up to 256 bits * EllipticCurve.p384 — up to 384 bits * EllipticCurve.p521 — up to 528 bits Also adds test coverage for all three curves at their maximum derive lengths in the ECDH test runner. Fixes google#130
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
mosuem
approved these changes
Jul 20, 2026
HamdaanAliQuatil
added a commit
that referenced
this pull request
Jul 24, 2026
* Move Flutter demo app into example/webcrypto_demo_flutter_app/ (#284) * refactor: move Flutter demo app into example/webcrypto_demo_flutter_app/ (#283) * chore: fix references to the relocated example app (#283) * chore: ignore unknown dartdoc example directive (#294) * refactor: replace runtime symbol lookup with direct FFI bindings (#279) * refactor: replace runtime symbol lookup with direct FFI bindings * refactor: replace runtime symbol lookup with direct FFI bindings * refactor: generate direct FFI bindings with ffigen * refactor: remove stale symbol table files * refactor: use Native.addressOf for EVP_PKEY finalizer * Reject imported EC and RSA keys with trailing bytes (#251) * Reject imported EC and RSA keys with trailing bytes * Add regression tests for issue 60 (trailing bytes in key imports) * Finalize regression tests for issue 60: hardcoded keys and browser compatibility * Update lib/src/testing/regression/issue_60_trailing_bytes.dart Co-authored-by: Jonas Finnemann Jensen <jopsen@gmail.com> * Update lib/src/testing/regression/issue_60_trailing_bytes.dart Co-authored-by: Jonas Finnemann Jensen <jopsen@gmail.com> * Fix trailing bytes regression fixture * Minimize trailing bytes fixture diff * Fix trailing bytes regression on web wasm * fix: FFI key import memory leaks and make trailing bytes tests --------- Co-authored-by: Jonas Finnemann Jensen <jopsen@gmail.com> * ci: add FFI memory-safety test lane (#295) * ci: add FFI memory-safety test lane * test: separate Valgrind runner from FFI workload * ci: run Valgrind in existing Linux job * refactor(js): fix JSDomException checks for wasm compatibility (#306) * refactor(js): fix JSDomException checks for wasm compatibility Resolve invalid_runtime_check_with_js_interop_types warnings for JSDomException. Instead of directly catching the extension type JSDomException or checking e is JSObject, we catch generic objects, cast them to JSAny?, and check if they are JSDomException instances using isA<subtle.JSDomException>(). This avoids platform-inconsistent runtime checks that behave incorrectly under dart2wasm where extension types are runtime-erased. * fix libraries * refactor(js): fix JSDomException type-checking crash under WASM Resolve _TypeError when casting generic exceptions to JSAny? under dart2wasm. * fix(testing): wire AES-GCM tagLength vectors (#312) * Fix AES-CTR large chunk handling (#309) * fix(aes-ctr): handle partial chunks larger than buffer * test(aes-ctr): refine large chunk coverage * fix(derive-bits): support zero-length results (#321) * docs: update RFC links to use the official RFC editor URLs (#245) Co-authored-by: Moritz <27859082+mosuem@users.noreply.github.com> * docs: move HMAC importRawKey example to file (#293) * chore: mark unsupported code paths with coverage:ignore (#327) * chore: mark unsupported code paths with coverage:ignore * test: mark impl_stub as coverage:ignore-file * test: ignore unreachable curve fallbacks in EC helpers * docs: correct JWK use value for AES keys (#330) * correct JWK use value for AES keys * correct JWK use value for AES keys * correct JWK use value for AES keys * Document maximum deriveBits length for ECDH curves (#289) Updates documentation on EcdhPrivateKey.deriveBits to include the maximum number of bits that can be derived for each curve: * EllipticCurve.p256 — up to 256 bits * EllipticCurve.p384 — up to 384 bits * EllipticCurve.p521 — up to 528 bits Also adds test coverage for all three curves at their maximum derive lengths in the ECDH test runner. Fixes #130 * Upgrade native_toolchain_cmake to v0.3 (#336) This new version improves Android SDK detection: rainyl/native_toolchain_cmake#31 * fix: use canonical RSA-OAEP JWK alg for SHA-1 (#337) --------- Co-authored-by: Samar Borkar <128998523+Samarborkar@users.noreply.github.com> Co-authored-by: Musharaf Khan Pathan <135562339+Apple-beep@users.noreply.github.com> Co-authored-by: HamdaanAliQuatil <96776914+HamdaanAliQuatil@users.noreply.github.com> Co-authored-by: Harshita Yadav <seemayadavanuj123@gmail.com> Co-authored-by: Jonas Finnemann Jensen <jopsen@gmail.com> Co-authored-by: Kevin Moore <kevmoo@users.noreply.github.com> Co-authored-by: Berkay Çatak <34205493+berkaycatak@users.noreply.github.com> Co-authored-by: Moritz <27859082+mosuem@users.noreply.github.com> Co-authored-by: AquibAquil <96966923+AquibAquil@users.noreply.github.com> Co-authored-by: w1boost1889M <63419938+w1boost1889M@users.noreply.github.com> Co-authored-by: Syed Moiz Ali <100577359+Syed-Moiz-Ali@users.noreply.github.com> Co-authored-by: Simon Ser <contact@emersion.fr>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #130
Updates
EcdhPrivateKey.deriveBitsdocumentation to specify the maximum number of bits that can be derived for each supported elliptic curve:EllipticCurve.p256— up to 256 bitsEllipticCurve.p384— up to 384 bitsEllipticCurve.p521— up to 528 bitsAlso adds test coverage for all three curves at their maximum derive lengths in the ECDH test runner (previously only P-256 with 32 bytes was tested).